package net.tensor.skynet.common;

import android.app.Application;
import android.util.Log;

import net.tensor.skynet.utils.OkHttpClientManager;

import java.io.IOException;

/**
 * @author Liting Wang
 * @date 07/12/2017
 */

public class Android4HttpsApplication extends Application {
    private static final String TAG = "Android4HttpsApp";

    @Override
    public void onCreate() {
        super.onCreate();
        try {
            OkHttpClientManager.getInstance()
                    .setOneWayCertificates(getAssets().open("server.cer"));
            //双向认证
            //OkHttpClientManager
            //.getInstance()
            //.setTwoWayCertificates(getAssets()
            //.open("client.bks")
            //,getAssets()
            //.open
            //("server.cer"));
        } catch (IOException e) {
            Log.e(TAG, e.getMessage());
        }
    }
}

